package com.maixy.easyexecl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @ClassName EasyExcelController
 * @Description TODO
 * @Date 2022/8/30 11:08
 * @Author Maixy
 */
@RestController
@RequestMapping("/easyExcel")
public class EasyExcelController {

    @Autowired
    private EasyExcelService easyExcelService;

    @PostMapping(value = "/importMemberList")
    public String importMemberList(@RequestParam("file") MultipartFile file, @RequestParam("id") Integer id) throws IOException {
        return easyExcelService.importMemberList(file, id);
    }
}
